import service from '@/utils/request'

export function getList(params) {
  return service({
    url: '/constantsItem/list',
    method: 'get',
    params
  })
}

/***
 * 查询所有类型
 * @returns {*}
 */
export function getTypeList() {
  return service({
    url: '/constantType/list',
    method: 'get',
    params:{
      pageNo:1,
      size:999999
    }
  })
}


export function getForm(id) {
  return service({
    url: '/constantsItem/queryById?itemId='+id,
    method: 'get'
  })
}


export function save(params) {
  return service({
    url: '/constantsItem/save',
    method: 'post',
    params
  })
}


export function update(params) {
  return service({
    url: '/constantsItem/update',
    method: 'post',
    params
  })
}
export function deleteById(id) {
  return service({
    url: '/constantsItem/deleteById?itemId='+id,
    method: 'get',
  })
}
